﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Web.UI.WebControls;
using Gencode.Common.SQL;

namespace Gencode.PrsWeb.App
{
	public class ComboDataGenerator
	{
        //public static DataView FillComboPlan(string mandid, bool addEmptyRow)
        //{
        //    DataView dv = SimpleQuerry.ExecuteForDataView("select Name, PlanID from ArbeitsPlan where Status = 1 and mandid = '" + mandid + "'");

        //    if (addEmptyRow)
        //    {
        //        DataRow row = dv.Table.NewRow();
        //        dv.Table.Rows.InsertAt(row, 0);
        //    }

        //    return dv;
        //}

		public static void BindData(DataView dv, ref DropDownList list, string dataToBind)
		{
			list.DataSource = dv;
			list.DataValueField = dataToBind;
			list.DataBind();
		}
	}
}
